import { createRouter, createWebHistory,createWebHashHistory } from "vue-router";

//路由数组
const routes = [
    {
        //基本格式
        path: "/",
        name: "index",
        component: () => import("../views/index/index.vue"),
    },
    {
        //基本格式
        path: "/login",
        name: "login",
        component: () => import("../views/login/login.vue"),
    },
    
];



//路由对象
const router = createRouter({
    history: createWebHashHistory(),
    routes, //上面的路由数组
});

router.beforeEach((to,from,next)=>{
   console.log()
    next()
})

//导出路由对象，在main.js中引用
export default router;
